class CollaborativePrayer < ActiveRecord::Base

		belongs_to	:user
		belongs_to	:prayer

		validates_presence_of		:user_id
		validates_presence_of		:prayer_id
		validates_uniqueness_of :user_id, :scope => :prayer_id

		protected
			
#			def validate
#				return if self.prayer_id.blank? || self.user_id.blank?
#				errors.add(:user_id, "Can't be collaborator of own prayer") if Prayer.find(prayer_id).user_id == self.user_id
#			end

end
